#include "ros/ros.h"
#include "geometry_msgs/Twist.h"

int main(int argc, char *argv[])
{
    setlocale(LC_ALL, "");
    ros::init(argc, argv, "custom_control_turtle");
    geometry_msgs::Twist twist;
    twist.angular.z = 1.0;
    twist.linear.x = 1.0;
    ros::NodeHandle nh = ros::NodeHandle();
    ros::Publisher pub = nh.advertise<geometry_msgs::Twist>("turtle1/cmd_vel", 10);
    while (ros::ok())
    {
        pub.publish(twist);
        ROS_INFO("发布的控制数据:linear.x=%f,angular.z=%f", twist.linear.x, twist.angular.z);
        ros::spinOnce();
    }
    return 0;
}
